package com.summer.data.jql.behavior;

import com.summer.data.Jsql;
import com.summer.data.annotation.Table;
import com.summer.data.dialect.Dialect;
import com.summer.data.jql.concept.Field;

/**
 * @author 345480567@qq.com
 */
public abstract class TableAble //implements SelectAble
{

    public abstract Jsql getTableSql(Dialect dialect);

    public String getTableName() {
        Table tableName = this.getClass().getAnnotation(Table.class);
        if (tableName == null) {
            throw new RuntimeException(this.getClass()+" 没有定义表名，请使用注解"+ Table.class.getName());
        } else {
            return tableName.value();
        }
    }

}
